#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdio.h>

int main(int argc,char** argv)
{
  struct stat stat_buf;
  int ret;
  ret = stat(argv[1],&stat_buf);
  if(ret < 0)
  {
    fprintf(stderr,"stat is fail\n");
    return -1;
  }
  
  printf("%s is size %ld\n",argv[1],stat_buf.st_size);

  if(S_ISREG(stat_buf.st_mode))
  {
    printf("It is a regular file\n");
  }
  return 0;
}
